<!DOCTYPE html>
<html>
<head>
    <include file="Include:meta"/>
    <title>项目合同列表-目的地运营集团数据管理平台</title>
    <include file="Include:style"/>
    <style>
        .background {
            background: #f5f5f5;
        }
    </style>
</head>
<body>
<include file="Include:header"/>
<include file="Include:left"/>
<div id="main">
    <div class="crumbs">
        <div class="crumbs-text">项目合同列表</div>
        <if condition="(is_permission('CRMH-T',NULL,1) or is_permission('CRMH-T',NULL,6))">
            <div class="right">
                <a href="__APP__/Contract/add" class="btn left mr5">添加项目合同</a>
            </div>
        </if>
    </div>
    <div id="content">
        <!--<div class="filter">
            <div class="filter-item">
                <div class="filter-title">所属中心：</div>
                <ul class="filter-order">
                    &lt;!&ndash;<foreach name="belong_id" item="vo">
                        <li
                        <if condition="$center_id eq $vo['name2']">class="current"</if>
                        >
                        <a href="__APP__/Financial/project_funds/keyword/{$keyword}/mode/{$mode}/center_id/{$vo['name2']}/type/{$type}/ptype/{$ptype}">{$vo['name1']}</a>
                        </li>
                    </foreach>&ndash;&gt;
                </ul>
            </div>
        </div>-->
        <div class="table-scrollx">
            <table class="table table-bordered">
                <tr class="table-header fixed-table-header">
                    <td width="">
                        <select name="project_id" class="form-control w100">
                            <option value=""
                            <if condition="$project_id eq null"> selected</if>
                            >项目编号</option>
                            <foreach name="crm_project_array" item="vo">
                                <option value="{$vo['project_id']}"
                                <if condition="$project_id eq $vo['project_id']"> selected</if>
                                >{$vo['project_num']}</option>
                            </foreach>
                        </select></td>
                    <td width="418">
                        <select name="project_id" class="form-control w400">
                            <option value=""
                            <if condition="$project_id eq null"> selected</if>
                            >关联项目</option>
                            <foreach name="crm_project_array" item="vo">
                                <option value="{$vo['project_id']}"
                                <if condition="$project_id eq $vo['project_id']"> selected</if>
                                >{$vo['name']}</option>
                            </foreach>
                        </select>
                    </td>
                    <td width="">合同编号</td>
                    <td width="">合同金额</td>
                    <td width="">签订人(签订日期)</td>
                    <td width="">合同开始日期</td>
                    <td width="">合同到期日期</td>
                    <td width="">合同附件</td>
                    <td width="">合同状态</td>
                    <td width="">付款方式</td>
                    <td width="">操作</td>
                    </if>
                </tr>
                <if condition="$result eq NULL">
                    <tr>
                        <td class="text-center" colspan="11">暂无相关内容</td>
                    </tr>
                </if>
                <foreach name="result" item="vo">
                    <tr>
                        <td><a class="xm_btn" href="javascript:;">{$vo['project_num']}</a></td>
                        <td>{$vo['name']}</td>
                        <td>{$vo['number']|default=""}</td>
                        <td>{$vo['contract_money']}</td>
                        <td>{:get_userName($vo['sign_user_id'])}({$vo['sign_contract_date']})</td>
                        <td>{$vo['sign_start_date']}</td>
                        <td>{$vo['sign_end_date']}</td>
                        <td><a href="{$vo.file_url}" target="_blank" data-toggle="tooltip" data-placement="right"
                               title="下载"
                               class="ml5">{$vo['file_name']}<i class="glyphicon glyphicon-download-alt mr5"></i></a>
                        </td>
                        <td>{:get_contract_status($vo['status'])}</td>
                        <td>{$vo['pay_way']}</td>
                        <td class="nowrap">
                            <if condition="(get_permission('CRMH-T',NULL,1) or get_permission('CRMH-T',NULL,2)or (get_permission('CRMH-T',NULL,3) and $vo['add_uid'] eq $login_id) or (get_permission('CRMH-T',NULL,7) and $vo['add_uid'] eq $login_id))">
                                <a href="__APP__/Contract/edit/id/{$vo['contract_id']}" data-toggle="tooltip"
                                   data-placement="left" title="" class="mr5"
                                   data-original-title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
                            </if>
                            <a href="javascript:;" class="delete" data-toggle="tooltip" data-placement="left"
                               title="删除" id="{$vo['contract_id']}"><i class="glyphicon glyphicon-trash"></i></a>
                        </td>
                    </tr>
                </foreach>
                </if>
            </table>
        </div>
        <div class="pages">{$page}</div>
    </div>
</div>
<!--项目弹框-->
<div class="modal fade" id="xm-modal">
    <div class="modal-dialog w800">
        <div class="modal-content">
            <div class="modal-header">
                <h4>项目款项详情</h4>
                <i class="fa fa-times" aria-hidden="true" data-dismiss="modal"></i>
            </div>
            <div class="modal-body">

            </div>
        </div>
    </div>
</div>
<!--开票弹框-->
<div class="modal fade" id="kp-modal">
    <div class="modal-dialog w800">
        <div class="modal-content">
            <div class="modal-header">
                <h4>项目开票详情</h4>
                <i class="fa fa-times" aria-hidden="true" data-dismiss="modal"></i>
            </div>
            <div class="modal-body">

            </div>
        </div>
    </div>
</div>
<!--收款弹框-->
<div class="modal fade" id="sk-modal">
    <div class="modal-dialog w800">
        <div class="modal-content">
            <div class="modal-header">
                <h4>项目收款详情</h4>
                <i class="fa fa-times" aria-hidden="true" data-dismiss="modal"></i>
            </div>
            <div class="modal-body">

            </div>
        </div>
    </div>
</div>
<include file="Include:javascript"/>
<script>
    $(function () {
        $(document).on("change", "[name='project_id']", function () {
            var val = $(this).val();
            window.location.href = "__APP__/Contract/index/project_id/" + val;
        });
        //删除
        $(".delete").ajaxModal({
            "title_text": "确认提示框",
            "body_text": "您确定要删除吗？",
            "url": "__APP__/Contract/del/id/",
            "data": {"id": "id"}
        });
    })
</script>
</body>
</html>